<?php
// Load Header
$this->pageTitle = __("Kết quả tìm kiếm", true);

// Load CSS
echo $this->Html->css('news_page');

// Load Javascript
//echo $this->Html->script('common.news');

?>
<div class="content news_page">
    <h1 class="title" id='title_of_content'><?php __("Kết quả tìm kiếm")?></h1>
	<div class="right_content">
		<!-- InstanceBeginEditable name="right content" -->
		
		<?php echo $this->element('gold_rate')?>
		<?php echo $this->element('exchange_rate')?>
		<?php echo $this->element('promotions'); ?>
		<!-- InstanceEndEditable -->
	</div>
    <div class="main_content">
        <?php if(count(${$models['Page']['plugin']}) < 1): ?>
            <h2><?php __("Không có kết quả nào phù hợp từ khóa tìm của bạn")?></h2>
        <?php else: ?>
        <ul class="news_block">
        	<?php foreach (${$models['Page']['plugin']} as $item):?>
            <?php //debug($item); exit(); ?>
            <?php $category_alias = $item['Category']['alias'];?>
        	<li>
        		<a href="<?php echo $html->url(array('plugin' => $models['Page']['plugin'], 'controller' => $models['Page']['plugin'], 'action' => 'view', $item[$models['Page']['name']]['alias'], $category_alias));?>">
        			<img class="img_news" src="<?php echo $html->url('/').'files/'.$models['Page']['plugin'].'/'.$html->getThumbnailName($item[$models['Page']['name']]['image'])?>"/>
        		</a>
        		<h4><a class="title_news" href="<?php echo $html->url(array('plugin' => $models['Page']['plugin'], 'controller' => $models['Page']['plugin'], 'action' => 'view', $item[$models['Page']['name']]['alias'], $category_alias));?>"><?php echo $item[$models['Page']['name']]['title']?></a></h4>
        		<p><?php echo strip_tags($item[$models['Page']['name']]['description'])?></p>
                <p><span><?php echo date("d/m/Y", strtotime($item[$models['Page']['name']]['description'])); ?></span></p>
        	</li>
        	<?php endforeach;?>
        </ul>
        <?php endif; ?>
        <?php echo $this->element('pagination/pagination', array('model' => $models['Page']['name']));?>
        <div class='go_to_top'>[ <a href='#'><?php __("Đầu trang"); ?></a> ]</div>
	</div>
</div>
